<template>
  <section>
    <div class="model management">
      <img :src="IMGBASE64.JIAOSHXINXIIGUANLI2X" class="pink">
    	<span class="title">教师工作组管理</span>
    	<div class="kong"></div>
    	<template>
    		<el-table :data="teacherData" style="width: 100%" @cell-click="showDetails">
          <el-table-column prop="value" label="#"  align="center"></el-table-column>
    			<el-table-column prop="modelId" label="模块Id"  align="center"></el-table-column>
    			<el-table-column prop="group" label="组名" align="center" :show-overflow-tooltip='true'></el-table-column>
    			<el-table-column prop="fatherId" label="父级Id" align="center" :show-overflow-tooltip='true'></el-table-column>
    			<el-table-column prop="groupCode" label="组code" align="center"></el-table-column>
    			<el-table-column prop="identity" label="身份" align="center" :show-overflow-tooltip='true'></el-table-column>
    			<el-table-column label="操作" align="center">
    				<template scope="scope">
    					<el-button type="sumbit" size="small" @click="xiugaiShow(scope)">修改</el-button>
    				</template>
    			</el-table-column>
    		</el-table>
        <el-pagination
          v-show="paging"
          @current-change="handleCurrentChange"
          :page-size="20"
          layout="prev, pager, next, jumper"
          :total="total"
          class="pull-right">
        </el-pagination>
    	</template>
    </div>
  </section>
</template>

<script>
export default {
  data () {
    return {
      total: 0,
      page: 1,
      paging: true,
      teacherData: [{
        value: '1',
        modelId: '10',
        group: '行政组',
        fatherId: '0',
        groupCode: null,
        identity: '校长,副校长,教研主任,德育主任,招生办主任,行政办公室主任,教务处主任'
      }]
    }
  },
  mounted () {
    // let _cookie = document.cookie.split(';')
    // let _cookieArray = []
    // _cookie.forEach(v => {
    //   let _d = v.split('=')
    //   _cookieArray.push({
    //     key: _d[0],
    //     value: _d[1]
    //   })
    // })
    this.$http.post(this._httpUrl + 'schoolGroupAndTeachers', {}, {'headers': {'yxt-xtoken': localStorage.xtoken}}).then(function (response) {
      if (response.body.code === '000') {
        console.log(response.data.data)
      } else if (response.body.code === '887') {
        this.$router.push('/')
      } else if (response.body.code === '889') {
        this.$router.push('/')
      }
    })
  },
  methods: {
    handleCurrentChange (val) {
      this.page = val
      // this.getTeacherNameData()
    },
    showDetails (rows, column) {
      // if (column.label !== '操作') {
      //   this.detailsForm.name = rows.name
      //   this.detailsForm.mobile = rows.mobile
      //   this.detailsForm.idNo = rows.idNo
      //   this.detailsForm.grade = rows.grade
      //   this.detailsForm.subject = rows.subject
      //   this.detailsForm.id = rows.type2
      //   this.detailsForm.homeAddr = rows.homeAddr
      //   this.isDetails = !this.isDetails
      //   this.isSuccess = !this.isSuccess
      // }
    }
  }
}
</script>

<style lang="less" scoped>
	
</style>
